package com.h2View.utils;

import cn.hutool.cache.impl.FIFOCache;

/**
 * @author 徐军文
 * @date 2021/7/3 1:22
 */
public class CacheUtil {

    private static FIFOCache<String,Object> fifoCache = cn.hutool.cache.CacheUtil.newFIFOCache(5000,1000*60*60*60*3);

    public static <T> T get(String key){
        return ToolUtil.cast(fifoCache.get(key));
    }

    public static void put(String key,Object value){
        fifoCache.put(key,value);
    }

    public static void put(String key,Object value,long timeout){
        fifoCache.put(key,value,timeout);
    }



}
